package com.lmq.factory.simple;
//静态工厂模式
//增加新产品比较麻烦

//开闭原则
public class CarFactory {
    public static Car getCar(String car){
        if (car.equals("五菱")){
            return new Wuling();
        }
        else if (car.equals("特斯拉")) {
            return new Tesla();
        }else {
            return null;
        }
    }

    public static Car getWuling(){
        return new Wuling();
    }
}
